import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:musician_flutter/generated/l10n.dart';
import 'package:musician_flutter/ui/route/route.dart';

/// 首页
class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(S.of(context).appName),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                context.push(routerUserScreenPage); // 跳转到布局切换页
              },
              child: const Text('用户中心'),
            ),
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: () {
                context.push(routerLayoutSwitcher); // 跳转到布局切换页
              },
              child: const Text('替换布局'),
            ),
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: () {
                context.push(routerSharePage); // 跳转到分享页面
              },
              child: const Text('分享页面'),
            ),
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: () {
                context.push(routerQRCodeWithText); // 跳转到二维码页面
              },
              child: const Text('二维码页面'),
            ),
          ],
        ),
      ),
    );
  }
}
